class Person:

    def __init__(self,name,age):
        self._name = name
        self._age = age

    def __str__(self):
        return f"我的名字是:{self._name},我年龄:{self._age}"

    @property
    def username(self):
        return self._name


    @username.setter
    def username(self,name):
        if name.isalpha():
            self._name = name

    @property
    def age(self):
        return self._age


    @age.setter
    def age(self,age):
        self._age = age


if __name__ == '__main__':
    xiaow = Person('xiaow',18)

    print(xiaow)

    print(xiaow.username)
    print(xiaow.age)

    xiaow.username = 'xiaoY'
    xiaow.age = 20

    print(xiaow)

    print(xiaow.username)
    print(xiaow.age)
